package MainTest;

import java.util.Calendar;
import java.util.Date;

public class AutoBoxing {
    Integer i;
    int j;
    public static void main(String[] args) {
        //AutoBoxing
        AutoBoxing t = new AutoBoxing();
        t.go(3);
        String s ="888";
        int sToi = Integer.parseInt(s);
        System.out.println(sToi);
        String iToS = Integer.toString(666);
        System.out.println(iToS);
        //format
        System.out.println(String.format("%,.1f", 8843.00));//fomat
        System.out.println(String.format("I have %,.2f,and %,d bugs to fix.", 77777777.009,1231));
        System.out.println(String.format("%d", 33));//decimal
        System.out.println(String.format("%.5f", 7.0));//floating point
        System.out.println(String.format("%x", 44));//hexdecimal
        System.out.println(String.format("%c", 44));//character
        //Date
        Date today = new Date();
        System.out.println(String.format("%tc", today));
        System.out.println(String.format("%tr", today));
        System.out.println(String.format("%tA,%<tB,%<td", today));//<能复用参数
        //Calendar
        Calendar cal = Calendar.getInstance();//抽象类的实例不能直接new
        System.out.println(cal.getTime());
    }
    public void go(int iii) {
        i=iii;
        j=i;
        System.out.println(j);
        System.out.println(i);
    }
}